package com.edu.study.base.stuQuestionRelation.service.impl;

import com.edu.study.base.stuQuestionRelation.domain.StuQuestionRelationRy;
import com.edu.study.base.stuQuestionRelation.mapper.StuQuestionRelationRyMapper;
import com.edu.study.base.stuQuestionRelation.service.IStuQuestionRelationRyService;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 题库关系Service业务层处理
 *
 * @author jjt
 * @date 2021-02-27
 */
@Service
//@DataSource(value = DataSourceType.SLAVE)
public class StuQuestionRelationRyServiceImpl implements IStuQuestionRelationRyService
{
    @Autowired
    private StuQuestionRelationRyMapper stuQuestionRelationRyMapper;

    /**
     * 查询题库关系
     *
     * @param id 题库关系ID
     * @return 题库关系
     */
    @Override
    public StuQuestionRelationRy selectStuQuestionRelationRyById(String id)
    {
        return stuQuestionRelationRyMapper.selectStuQuestionRelationRyById(id);
    }

    /**
     * 查询题库关系列表
     *
     * @param stuQuestionRelationRy 题库关系
     * @return 题库关系
     */
    @Override
    public List<StuQuestionRelationRy> selectStuQuestionRelationRyList(StuQuestionRelationRy stuQuestionRelationRy)
    {
        return stuQuestionRelationRyMapper.selectStuQuestionRelationRyList(stuQuestionRelationRy);
    }


    /**
     * 新增题库关系
     *
     * @param stuQuestionRelationRy 题库关系
     * @return 结果
     */
    @Override
    public int insertStuQuestionRelationRy(StuQuestionRelationRy stuQuestionRelationRy)
    {
        return stuQuestionRelationRyMapper.insertStuQuestionRelationRy(stuQuestionRelationRy);
    }

    @Override
    public int insertStuQuestionRelationList(List<StuQuestionRelationRy> stuQuestionRelationList) {
        return stuQuestionRelationRyMapper.insertStuQuestionRelationList(stuQuestionRelationList);
    }

    /**
     * 修改题库关系
     *
     * @param stuQuestionRelationRy 题库关系
     * @return 结果
     */
    @Override
    public int updateStuQuestionRelationRy(StuQuestionRelationRy stuQuestionRelationRy)
    {
        return stuQuestionRelationRyMapper.updateStuQuestionRelationRy(stuQuestionRelationRy);
    }

    /**
     * 批量删除题库关系
     *
     * @param ids 需要删除的题库关系ID
     * @return 结果
     */
    @Override
    public int deleteStuQuestionRelationRyByIds(String[] ids)
    {
        return stuQuestionRelationRyMapper.deleteStuQuestionRelationRyByIds(ids);
    }

    @Override
    public int deleteStuQuestionRelationRyByQuestionIds(String[] ids) {
        return stuQuestionRelationRyMapper.deleteStuQuestionRelationRyByQuestionIds(ids);
    }

    @Override
    public int deleteStuQuestionRelationRyByBussIds(String[] ids) {
        return stuQuestionRelationRyMapper.deleteStuQuestionRelationRyByBussIds(ids);
    }

    /**
     * 删除题库关系信息
     *
     * @param id 题库关系ID
     * @return 结果
     */
    @Override
    public int deleteStuQuestionRelationRyById(String id)
    {
        return stuQuestionRelationRyMapper.deleteStuQuestionRelationRyById(id);
    }

    @Override
    public int deleteStuQuestionRelationRyByBussId(String id) {
        return stuQuestionRelationRyMapper.deleteStuQuestionRelationRyByBussId(id);
    }

    @Override
    public int deleteStuQuestionRelationRyByCourseId(String courseId) {
        return stuQuestionRelationRyMapper.deleteStuQuestionRelationRyByBussId(courseId);
    }


}
